﻿using Yoozoo.Libs;

namespace Yoozoo.Modules.InnerCity
{
    public abstract class ActionBase : IClass
    {
        protected CityUnit owner;
        
        protected abstract StateAction state { get; }

        public StateAction State
        {
            get => this.state;
        }

        public virtual void Init(CityUnit owner)
        {
            this.owner = owner;
        }

        public virtual void Enter(object arg = null)
        {
            
        }

        public virtual void Play()
        {
            
        }

        public virtual void Exit()
        {
            
        }

        public void OnReset()
        {
            Dispose();
        }

        protected virtual void Dispose()
        {
            this.owner = null;
        }
    }
}